php forum
php mysql forum
php mysql smarty
 
Topic Options
#317915 - 03/21/09 02:25 PM [7.5.1] Remove image tags in quotes
blaaskaak Offline
Enthusiast

Registered: 02/25/07
Posts: 329
Loc: The Netherlands
This mod replaces any image tags in a quote and replaces them with url tags.

open /scripts/quickquote.inc.php

Find:

Code:
} // end if



Add after:

Code:
$post_body = preg_replace('%\[(img|img:left|img:right|img:center|image|image:left|image:center|image:right)\]%i', '[url]', $post_body);
	$post_body = preg_replace('%\[(/img|/image)\]%i', '[/url]', $post_body);



open /scripts/newreply.inc.php

Find:
Code:
if ($q == 1) {



add after:
Code:
$RawBody = preg_replace('%\[(img|img:left|img:right|img:center|image|image:left|image:center|image:right)\]%i', '[url]', $RawBody);
		$RawBody = preg_replace('%\[(/img|/image)\]%i', '[/url]', $RawBody);



That's it.

I also have a line that replaces youtube with a link.

Code:
$post_body = preg_replace('%\[youtube\](|.*v=)([-\w]{8,12})(|&.*)\[/youtube\]%i', '[url]http://www.youtube.com/watch?v=\\2[/url]', $post_body);



that you could implement that also for other video's you might embed. Above works for [youtube]url or id[/youtube].


Edited by blaaskaak (03/21/09 02:26 PM)
_________________________

Top
#317917 - 03/21/09 07:55 PM Re: [7.5.1] Remove image tags in quotes [Re: blaaskaak]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
I like it, heres a vote to make it in the next build :x...
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#317918 - 03/21/09 09:50 PM Re: [7.5.1] Remove image tags in quotes [Re: Gizmo]
DLWebmaestro Offline
Addict

Registered: 08/08/00
Posts: 1802
Loc: North Carolina
Oooo... good idea!

Top
#317926 - 03/24/09 01:10 PM Re: [7.5.1] Remove image tags in quotes [Re: DLWebmaestro]
AllenAyres Offline

I type Like navaho

Registered: 03/10/00
Posts: 25580
Loc: Texas
Thanks Yarp™!
_________________________
- Allen wavey
- What Drives You?

Top



Moderator:  sirdude 
Latest Posts
[7.2.1] - Naked shoutbox
by bellaonline
05/05/12 05:00 PM
[7.x] Stop Forum Spam Integration v0.4
by bellaonline
05/05/12 03:53 PM
Shout Box

(Views)Popular Topics
Known public proxy servers 1689885
Integrated Index Page (IIP) 5.3.1 555705
Finished-[6.5.2] Games Arcade Deluxe v1.9 501236
Integrated Index Page (IIP) 5.1.1 415112
TLD Bv2.1 Released - Threads Links Directory 396822
[6.0x] Who's Online 4.0.0 [Finished] 389412
Finished-[6.5.1] Integrated Index Page (IIP) 6.5 330423
Q & A 298663
Slash UBB 266936
[6.3.x] [beta] Hit Hack 2.0 227970
Forum Stats
13621 Members
59 Forums
37191 Topics
295716 Posts

Max Online: 686 @ 06/28/07 07:04 AM

 

 

 
fusionbb message board php hacks